<template>
  <div class="announcement" @click="toArticle()">
    <span class="icon-Notice"></span><p>{{ articleTitle }}</p>
  </div>
</template>

<script>
  export default {
    data () {
      return {
        uuid: null,
        articleTitle: null
      }
    },
    methods: {
      toArticle () {
        this.$router.push(`/article/${this.uuid}`)
      }
    },
    created () {
      this.$http.get(`/api/base/baseArticle/list?currentPage=1&numPerPage=1&artTypeId=1`)
        .then((res) => {
          if (res.data.success) {
            this.uuid = res.data.data.list[0].uuid
            this.articleTitle = res.data.data.list[0].title
          }
        })
        .catch((err) => {
          alert(err)
        })
    }
  }
</script>

<style lang='scss'>
  @import '../../common/scss/tool.scss';
  @import '../../common/scss/_variable.scss';
 
  .announcement {
    display: flex;
    box-sizing: border-box;
    width: 100%;
    height: 70px;
    padding-left: 30px;
    background: $base-fff;
    font-size: 0;
    line-height: 69px;
    border-bottom: 1px solid $base-e5e5e5;
    span {
      padding-right: 10px;
      font-size: 36px;
      line-height: 74px;
      vertical-align: text-top;
      color: $base-ff6c00;
    }
    p {
      height: 76px;
      color: $base-666;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      font-size: 28px;
      line-height: 76px;
    }
  }
</style>
